package us.codecraft.jobhunter.model;

import us.codecraft.webmagic.Page;
import us.codecraft.webmagic.model.AfterExtractor;
import us.codecraft.webmagic.model.annotation.ExtractBy;
import us.codecraft.webmagic.model.annotation.ExtractByUrl;
import us.codecraft.webmagic.model.annotation.HelpUrl;
import us.codecraft.webmagic.model.annotation.TargetUrl;

/**
 * @author 18042681971@163.com
 *         Date: 2016-04-03
 *         Time: 下午3:26
 */
@TargetUrl("https://job.liepin.com/[\\d_]+")
@HelpUrl("https://www.liepin.com/zhaopin/\\?dqs=000&industries=040%2C010%2C030&curPage=\\d+")
public class LieTouJobInfo implements AfterExtractor {
    //职位信息
    @ExtractBy("//div[@class='title-info']/h1/text()")
    private String title="";
    //工资信息
    @ExtractBy("//p[@class='job-main-title']/text()")
    private String salary="";
    //公司信息
    @ExtractBy("//div[@class='title-info']/h3/a/text()")
    private String company="";
    //行业类型
    @ExtractBy("//div[@class='right-blcok-post']//div[@class='right-post-top']//div[@class='content content-word']//a/text()")
    private String industry;
    //学历要求
    @ExtractBy("//div[@class='resume clearfix']/span[1]/text()")
    private String requirement="";
    //发布时间
    @ExtractBy("//div[@class='job-title-left']/p[@class='basic-infor']/span[2]/text()")
    private  String releasetime;
    //工作年限
    @ExtractBy("//div[@class='resume clearfix']/span[2]/text()")
    private String workyears;
    //公司规模
    @ExtractBy("//div[@class='right-blcok-post']//div[@class='right-post-top']//div[@class='content content-word']/text()")
    private String companyscale;
    //地区信息
    @ExtractBy("//div[@class='job-title-left']//p[@class='basic-infor']/span[1]/text()")
    private String regionalinfo;
    private String source="lietou.com";
    @ExtractByUrl
    private String url="";

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getRegionalinfo() {
        return regionalinfo;
    }

    public void setRegionalinfo(String regionalinfo) {
        this.regionalinfo = regionalinfo;
    }

    public String getCompanyscale() {
        return companyscale;
    }

    public void setCompanyscale(String companyscale) {
        this.companyscale = companyscale;
    }

    public String getWorkyears() {
        return workyears;
    }

    public void setWorkyears(String workyears) {
        this.workyears = workyears;
    }

    public String getReleasetime() {
        return releasetime;
    }

    public void setReleasetime(String releasetime) {
        this.releasetime = releasetime;
    }

    public String getRequirement() {
        return requirement;
    }

    public void setRequirement(String requirement) {
        this.requirement = requirement;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getSalary() {
        return salary;
    }

    public void setSalary(String salary) {
        this.salary = salary;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getIndustry() {
        return industry;
    }

    public void setIndustry(String industry) {
        this.industry = industry;
    }

    @Override
    public String toString() {
        return "LieTouJobInfo{" +
                "title='" + title + '\'' +
                ", salary='" + salary + '\'' +
                ", company='" + company + '\'' +
                ", industry='" + industry + '\'' +
                ", requirement='" + requirement + '\'' +
                ", releasetime='" + releasetime + '\'' +
                ", workyears='" + workyears + '\'' +
                ", companyscale='" + companyscale + '\'' +
                ", regionalinfo='" + regionalinfo + '\'' +
                ", source='" + source + '\'' +
                ", url='" + url + '\'' +
                '}';
    }

    @Override
    public void afterProcess(Page page) {
    }
}
